import api from '../../api'

const getAllAppList = function (params) {
  return api.getRequest(api.requestURL + 'web' + api.apiVer + 'clients/list', params)
}

const genAppId = function (params) {
  return api.getRequest(api.requestURL + 'web' + api.apiVer + 'clients/genClientId', params)
}

const saveOrUpdateApp = function (params) {
  return api.postRequest(api.requestURL + 'web' + api.apiVer + 'clients/saveOrUpdate', params)
}

const getAppDetail = function (params) {
  return api.getRequest(api.requestURL + 'web' + api.apiVer + 'clients/' + params.id)
}

const deleteApp = function (params) {
  return api.deleteRequest(api.requestURL + 'web' + api.apiVer + 'clients/' + params.id)
}

export default {
  getAllAppList,
  genAppId,
  saveOrUpdateApp,
  getAppDetail,
  deleteApp
}
